using UnityEngine;
using System.Collections;

namespace ViNoToolkit{

	/// <summary>
	/// Trigger volume event data.
	/// </summary>
	public class TriggerVolumeEventData : ViNoEventData{
		public Collider collider;
	}

	/// <summary>
	/// Trigger volume. please attach this script to a player.
	/// </summary>
	public class TriggerVolume : MonoBehaviour {

		private TriggerVolumeEventData m_EvtData = new TriggerVolumeEventData();	// Cached Event Data.

		void OnTriggerEnter(Collider other){
//			Debug.Log ( "EvtType:" + m_EvtData.eventType );

			m_EvtData.eventType = "OnTriggerEvent";
			m_EvtData.collider = other;

			// EventManager will send message to event receiver.
			ViNoEventManager.Instance.TriggerEvent ( m_EvtData.eventType , m_EvtData );
		}

	}

}